package config
{
    import flash.display.DisplayObject;
    import flash.display.DisplayObjectContainer;
    import flash.display.Sprite;
    import flash.filters.GlowFilter;
    import flash.geom.Rectangle;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;



    public class AssetTools
    {
//		private static var _empty:Sprite = new Sprite();
        public static function getAssetRect(assets:DisplayObject):Rectangle
        {
            return new Rectangle (assets.x , assets.y , assets.width , assets.height);
//			_empty.addChild(asset);
//			var rect:Rectangle = _empty.getBounds(asset);
//			_empty.removeChild(asset);
//			return rect;
        }

        public static function get selectedFilter():GlowFilter
        {
            return new GlowFilter (0x1FFFFF);
        }

        public static function get textFieldFilter():GlowFilter
        {
            return new GlowFilter (0 , 1 , 2 , 2 , 5);
        }

        public static function get textFieldTextForamt():TextFormat
        {
            return new TextFormat ('simsun');
        }

        public static function setTextField(tf:TextField = null , color:uint = 0xCCCCCC , size:Object = null , leading:Object = null):void
        {
            if (tf == null)
                tf = new TextField ();
            var format:TextFormat = textFieldTextForamt;
            format.color = color;
            format.size = size;
            format.leading = leading;
            tf.setTextFormat (format);
            tf.defaultTextFormat = format;
            tf.filters = [textFieldFilter];
        }
    }
}
